package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itheima.domain.db.BlackList;
import com.itheima.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

// 黑名单
public interface BlackListMapper extends BaseMapper<BlackList> {

    //根据当前用户查询出当前用户对应的 黑名单数据
    @Select("SELECT ui.* FROM `tb_black_list`  bl \n" +
            "\tINNER JOIN `tb_user_info` ui ON bl.`black_user_id`=ui.`id`\n" +
            "\tWHERE bl.`user_id`=#{userId}")
    IPage<UserInfo> findBlackListUserByUid(IPage iPage ,@Param("userId") Long userId);
}